/*! _modals.scss | Vuero | Css ninja 2020-2021 */

/*
    1. Base Class
    2. H Modal
    3. H Modal Dark mode
    4. Media queries
*/

/* ==========================================================================
1. Base Class
========================================================================== */

.modal {
  transition: all 0.5s;

  &.is-big {
    .modal-content {
      width: 100%;
      max-width: 840px;

      .modal-card {
        width: 100%;
      }
    }
  }

  &.is-large {
    .modal-content {
      width: 100%;
      max-width: 720px;

      .modal-card {
        width: 100%;
      }
    }
  }

  &.is-medium {
    .modal-content {
      width: 100%;
      max-width: 640px;

      .modal-card {
        width: 100%;
      }
    }
  }

  &.is-small {
    .modal-content {
      width: 100%;
      max-width: 420px;

      .modal-card {
        width: 100%;
      }
    }
  }

  .modal-content {
    transition: all 0.4s;
  }
}

/* ==========================================================================
2. H Modal
========================================================================== */

.v-modal {
  &.is-active {
    z-index: 200 !important;

    .v-modal-close {
      cursor: pointer;
    }
  }

  .v-modal-card {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--fade-grey);
    border-radius: 8px;
    padding: 40px;
  }

  .modal-background {
    background-color: hsla(
      var(--dark-sidebar-h),
      var(--dark-sidebar-s),
      var(--dark-sidebar-l),
      0.8
    );
  }

  .modal-content {
    transform: scale(1) !important;
    opacity: 1 !important;
    max-width: 540px;
    overflow-x: hidden;
    animation: fadeInDown 0.5s;
    margin: 0;
    padding: 0 10px;

    .modal-card {
      max-width: 100%;
      margin: 0 auto;

      &.is-rounded {
        border-radius: 12px;
      }

      .modal-card-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: var(--white);
        border-bottom-color: var(--fade-grey-dark-3);

        &.no-border {
          border-bottom-color: transparent;
        }

        h3 {
          font-family: var(--font-alt);
          color: var(--dark-text);
          font-weight: 600;
          font-size: 1rem;
        }

        .v-modal-close {
          display: flex;
          justify-content: center;
          align-items: center;
          background: none;
          border-color: transparent;
          width: 22px;
          height: 22px;
          padding: 0;
          outline: none !important;

          &:hover {
            svg {
              color: var(--primary);
            }
          }

          svg {
            width: 22px;
            height: 22px;
            color: var(--muted-grey);
          }
        }
      }

      .modal-card-body {
        .modal-form {
          padding: 10px 0 20px 0;
        }

        &.has-tabs {
          padding: 0;
          overflow-x: hidden;

          .tabs {
            overflow-x: auto;

            &::-webkit-scrollbar {
              height: 5px !important;
            }

            &::-webkit-scrollbar-thumb {
              border-radius: 10px !important;
              background: rgba(0, 0, 0, 0.2) !important;
            }

            a {
              padding: 0.75em 1em;
            }
          }
        }
      }

      .modal-card-foot {
        background-color: var(--white);
        padding: 15px 20px;
        border-top: 1px solid var(--fade-grey-dark-3);

        &.no-border {
          border-top-color: transparent;
        }

        &.is-start {
          justify-content: flex-start !important;
        }

        &.is-centered {
          justify-content: center !important;
        }

        &.is-end {
          justify-content: flex-end !important;
        }

        .v-button {
          min-width: 110px;
        }
      }
    }
  }
}

/* ==========================================================================
3. H Modal Dark mode
========================================================================== */

.is-dark {
  .v-modal {
    .modal-background {
      background: rgba(101, 101, 104, 0.8) !important;
    }

    .modal-content {
      .modal-card {
        .modal-card-head {
          background: var(--dark-sidebar-light-6) !important;
          border-color: var(--dark-sidebar-light-12);

          h3 {
            color: var(--dark-dark-text);
          }

          .v-modal-close {
            &:hover {
              svg {
                color: var(--primary);
              }
            }
          }
        }

        .modal-card-body {
          background: var(--dark-sidebar-light-6) !important;
        }

        .modal-card-foot {
          background: var(--dark-sidebar-light-6) !important;
          border-color: var(--dark-sidebar-light-12);
        }
      }
    }
  }
}

/* ==========================================================================
4. Media queries
========================================================================== */

@media screen and (min-width: 769px) {
  .modal.modal-lg {
    .modal-card,
    .modal-content {
      width: 800px !important;
    }
  }

  .modal.modal-sm {
    .modal-card,
    .modal-content {
      width: 400px !important;
    }
  }
}
